package com.lyj.mode.factory.simple;

/**
 * 蛋糕工厂
 * @author:liyajie
 * @createTime:2022/2/14 10:16
 * @version:1.0
 */
public class CakeFactory {

    public Cake createCake(String type){
        if("apple".equals(type)){
            return new AppleCake();
        }else if("banana".equals(type)){
            return new BananaCake();
        }else {
            return null;
        }
    }
}
